package com.lb.javacore2;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * @ClassName StreamApi
 * @Author hp
 * @Date 2021/5/30 22:28
 * @Version 1.0
 **/
public class StreamApi {
    public static void main(String[] args) {
        try {
            char a = '\u2121';
            System.out.println(a);
            String content = new String(Files.readAllBytes(Paths.get("D:\\test.txt")), StandardCharsets.UTF_8);
            List<String> list = Arrays.asList(content.replaceAll(" ","").split("o"));
            Stream<String> stringStream = list.parallelStream();
            long count = stringStream.count();
            System.out.println(count);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
